﻿using System;
using System.Collections.Generic;
using System.Text;
using Acid.Math;
namespace Acid.Interaction
{
    public enum ScreenOrientation
    {
        Landscape        = 0,
        ReverseLandscape = 1,
        Portrait         = 2,
        ReversePortrait  = 3, // upside down
        FaceDown         = 4,
        FaceUp           = 5
    }

    public delegate void OrientationChangedHandler(IGSensor sender);

    public interface IGSensor
    {
        /// <summary>
        /// Returns a vector that desribes the direction of gravity/acceleration in relation to the device screen.
        /// When the device is face up on a flat surface, this method would return 0, 0, -9.8.
        /// The Z value of -9.8 would mean that the acceleration in the opposite direction of the orientation of the screen.
        /// When the device is held up, this method would return 0, -9.8, 0.
        /// The Y value of -9.8 would mean that the device is accelerating in the direction of the bottom of the screen.
        /// Conversely, if the device is held upside down, this method would return 0, 9.8, 0.
        /// </summary>
        /// <returns>
        /// The vector returned will have a length measured in the unit meters per second square.
        /// Ideally the when the device is in a motionless state, the vector would be of length 9.8.
        /// However, the sensor is not extremely accurate, so this almost never the case.
        /// </returns>
        Vector3 GetGVector();

        ScreenOrientation Orientation
        {
            get;
        }

        event OrientationChangedHandler OrientationChanged;
    }
}
